package com.zyh.javase_shijuan.test4.domain;

public class Student {
    private String name;
    private int score;
    public Teacher teacher;

    public Student() {
    }

    public Student(String name, int score, Teacher teacher) {
        this.name = name;
        this.score = score;
        this.teacher = teacher;
    }

    public void getMyResult() {
        System.out.println("我是" + getName() + "学生，我的老师是" + getTeacher().getName() + "，他教我"+getTeacher().getCourse()+"学科");
        if (getScore()>=60){
            System.out.println("继续加油噢");
        }
        else {
            System.out.println("成绩太低了，老师"+getTeacher().getName()+"让我回去罚抄100遍");
        }
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public Teacher getTeacher() {
        return teacher;
    }

    public void setTeacher(Teacher teacher) {
        this.teacher = teacher;
    }
}
